Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Basic Authentication #492

Merged
merged 1 commit into from
Aug 22, 2018
Merged

Conversation

lxhoan
Copy link
Contributor

@lxhoan lxhoan commented Aug 21, 2018

No description provided.

@codecov-io
Copy link

codecov-io commented Aug 21, 2018

Codecov Report

Merging #492 into master will increase coverage by 0.04%.
The diff coverage is 93.75%.

Impacted file tree graph

@@             Coverage Diff             @@
##             master    #492      +/-   ##
===========================================
+ Coverage     87.35%   87.4%   +0.04%     
- Complexity      362     364       +2     
===========================================
  Files            24      25       +1     
  Lines          1503    1500       -3     
  Branches        167     167              
===========================================
- Hits           1313    1311       -2     
+ Misses          124     123       -1     
  Partials         66      66
Impacted Files Coverage Δ Complexity Δ
...n/java/org/influxdb/impl/BasicAuthInterceptor.java 100% <100%> (ø) 2 <2> (?)
src/main/java/org/influxdb/impl/InfluxDBImpl.java 89.8% <90%> (+0.02%) 78 <4> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f31b2fd...090864f. Read the comment docs.

@majst01
Copy link
Collaborator

majst01 commented Aug 21, 2018

LGTM

@majst01
Copy link
Collaborator

majst01 commented Aug 21, 2018

Hi @lxhoan would you mind adding a CHANGELOG entry ?

@lxhoan lxhoan changed the title imlement issue #449 : support for Basic Authentication Support for Basic Authentication Aug 21, 2018
@lxhoan
Copy link
Contributor Author

lxhoan commented Aug 21, 2018

changelog added

Copy link
Contributor

@fmachado fmachado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this PR, we will create a new minor version that is not backward compatible. Is this correct or I am missing something?

@lxhoan
Copy link
Contributor Author

lxhoan commented Aug 21, 2018

with reference to InfluxDb document

https://docs.influxdata.com/influxdb/v1.6/administration/authentication_and_authorization/
Hi @fmachado, it's still backward compatible (actually in the client now Authentication scheme is transparent to user). I just propose to to switch to Basic Auth because in InfluxDB document

https://docs.influxdata.com/influxdb/v1.6/administration/authentication_and_authorization/

basic authentication "is the preferred method for providing user credentials"

@fmachado
Copy link
Contributor

@lxhoan ok but you modified the existing public API by removing parameters and this will break the existing users implementation when they update the library.

@@ -39,49 +39,44 @@
* Can be one of one, any, all, quorum. Defaults to all.
*/
@POST("write")
public Call<ResponseBody> writePoints(@Query(U) String username,
@Query(P) String password, @Query(DB) String database,
public Call<ResponseBody> writePoints(@Query(DB) String database,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(RP) String retentionPolicy, @Query(PRECISION) String precision,
@Query(CONSISTENCY) String consistency, @Body RequestBody batchPoints);

@GET("query")
public Call<QueryResult> query(@Query(U) String username, @Query(P) String password, @Query(DB) String db,
public Call<QueryResult> query(@Query(DB) String db,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(EPOCH) String epoch, @Query(value = Q, encoded = true) String query);

@POST("query")
public Call<QueryResult> query(@Query(U) String username, @Query(P) String password, @Query(DB) String db,
public Call<QueryResult> query(@Query(DB) String db,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(EPOCH) String epoch, @Query(value = Q, encoded = true) String query,
@Query(value = PARAMS, encoded = true) String params);

@GET("query")
public Call<QueryResult> query(@Query(U) String username, @Query(P) String password, @Query(DB) String db,
public Call<QueryResult> query(@Query(DB) String db,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(value = Q, encoded = true) String query);

@POST("query")
public Call<QueryResult> postQuery(@Query(U) String username, @Query(P) String password, @Query(DB) String db,
public Call<QueryResult> postQuery(@Query(DB) String db,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(value = Q, encoded = true) String query);

@POST("query")
public Call<QueryResult> postQuery(@Query(U) String username, @Query(P) String password, @Query(DB) String db,
public Call<QueryResult> postQuery(@Query(DB) String db,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(value = Q, encoded = true) String query, @Query(value = PARAMS, encoded = true) String params);

@GET("query")
public Call<QueryResult> query(@Query(U) String username, @Query(P) String password,
@Query(value = Q, encoded = true) String query);
public Call<QueryResult> query(@Query(value = Q, encoded = true) String query);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)


@POST("query")
public Call<QueryResult> postQuery(@Query(U) String username,
@Query(P) String password, @Query(value = Q, encoded = true) String query);
public Call<QueryResult> postQuery(@Query(value = Q, encoded = true) String query);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)


@Streaming
@GET("query?chunked=true")
public Call<ResponseBody> query(@Query(U) String username,
@Query(P) String password, @Query(DB) String db, @Query(value = Q, encoded = true) String query,
public Call<ResponseBody> query(@Query(DB) String db, @Query(value = Q, encoded = true) String query,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

@Query(CHUNK_SIZE) int chunkSize);

@Streaming
@POST("query?chunked=true")
public Call<ResponseBody> query(@Query(U) String username,
@Query(P) String password, @Query(DB) String db, @Query(value = Q, encoded = true) String query,
public Call<ResponseBody> query(@Query(DB) String db, @Query(value = Q, encoded = true) String query,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

parameters removed: (non-backward compatible change)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, InfluxDBService provides only a internal API which @lxhoan adopted, the only visible API is InfluxDB,java and that didnt change.

Or did i miss something ?

Copy link
Contributor Author

@lxhoan lxhoan Aug 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the method signatures are all public however the interface (InfluxDBService) itself is visible to org.influxdb.impl only, so I don't think user can import this interface in their implementation

Copy link
Contributor

@fmachado fmachado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ops! I missed the class access modifier!

@majst01 majst01 merged commit 24c5542 into influxdata:master Aug 22, 2018
@lxhoan lxhoan added this to the 2.13 milestone Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants